#pragma once
#include "LabelHeader.h"
#include "ImageHeader.h"

namespace MnistDigit
{
	struct SetInfo;
	class Visitor;

	class Loader
	{
	public:
		Loader(const SetInfo& setInfo, Visitor& visitor);
		~Loader(void);
		void LoadSets();
	private:

		void LoadHeaders();
		void LoadLabelHeader();
		void LoadImageHeader();

		void LoadData();
		void AddDigit(const unsigned char digit, const std::vector<unsigned char>& dataBuffer);

		std::ifstream m_labelSet;
		std::ifstream m_imageSet;

		LabelHeader m_labelHeader;
		ImageHeader m_imageHeader;

		Visitor& m_visitor;
		const SetInfo& m_setInfo;
	};


}